//
//  CSTImageTableViewCell.m
//  classroom
//
//  Created by Macx on 16/7/31.
//  Copyright © 2016年 LiuZhuo. All rights reserved.
//

#import "CSTImageTableViewCell.h"
#import "CSBigImage.h"

@interface CSTImageTableViewCell()
@property (weak, nonatomic) IBOutlet UILabel *titileLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageView1;
@property (weak, nonatomic) IBOutlet UIImageView *imageView2;
@property (weak, nonatomic) IBOutlet UIImageView *imageView3;
@property (weak, nonatomic) IBOutlet UIImageView *imageView4;

@end

@implementation CSTImageTableViewCell

- (void)awakeFromNib {
    //修改CELL的选中样式
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    [self addClick:_imageView1];
    [self addClick:_imageView2];
    [self addClick:_imageView3];
    [self addClick:_imageView4];

    
    
}
-(void)addClick:(UIImageView *)imageV{
    UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scanBigImageClick:)];
    [imageV addGestureRecognizer:tapGestureRecognizer];
    [imageV setUserInteractionEnabled:YES];
    
}

-(void)scanBigImageClick:(UITapGestureRecognizer *)tap{
    UIImageView *clickedImageView = (UIImageView *)tap.view;
    [CSBigImage scanBigImageWithImageView:clickedImageView];
}


-(void)setModel:(CSCellModel *)model{
    _model = model;
    _titileLabel.text = model.name;
    _imageView1.image = [UIImage imageNamed:model.icon1];
    _imageView2.image = [UIImage imageNamed:model.icon2];
    _imageView3.image = [UIImage imageNamed:model.icon3];
    _imageView4.image = [UIImage imageNamed:model.icon4];
  
}

@end
